1. Field of the Invention
The present invention relates to an image encoding apparatus and method, for compressing an image by wavelet transformation and entropy coding as in JPEG-2000, a program allowing a computer to make the image coding, and a recording medium having the program recorded therein.
This application claims the priority of the Japanese Patent Application No. 2002-350185 filed on Dec. 2, 2002, the entirety of which is incorporated by reference herein.
2. Description of the Related Art
Images can be stored in compressed form by the Joint Photographic Experts Group (JPEG) technique standardized by the International Standards Organization (ISO), a typical one of the conventional image compression techniques. The JPEG uses a discrete cosine transform (DCT). Considering the allocation of relatively many bits, the JPEG method is known for providing good encoded and decoded images. However, the number of encoded bits, smaller than a certain extent, will result in a remarkable block distortion peculiar to DCT and a noticeable subjective deterioration.
On the other hand, there have recently been made active studies of image compression techniques by which an image is divided into a plurality of bands by a so-called filter bank formed from a high-pass filter and low-pass filter in combination and each of the bands is encoded. Of these image compression techniques, the coding by the wavelet transformation is most likely to be a new technique that takes the place of DCT, as it does not have the disadvantage of remarkable block distortion caused by high compression.
The above-mentioned JPEG-2000 established as an international standard in January, 2001 adopts a combination of the wavelet transformation and a high-efficiency entropy coding (bit modeling and algebraic coding in units of a bit plane) and attains a considerably improved efficiency of coding as compared with JPEG.
The above international standards define only the requirements regarding the decoder and the encoder can freely be designed. On the other hand, since they include no standard for an effective rate controlling technique to attain a target rate of compression, it is the most important thing to establish a know-how of the bit rate control. Especially with the JPEG technique, it is difficult to control the rate and also it is necessary to encode data a plurality of times until a target rate is attained, which leads to an increased time of data processing. Therefore, the JPEG-2000 technique should desirably be able to generate a target number of codes by one try of coding.
On this account, the Inventors of the present invention proposed a technique of controlling the rate by truncating the tail end of a code stream once generated, as disclosed in the Japanese Patent Application Laid-Open No. 2002-165098. With this technique, it is capable to control the rate precisely according to a target number of codes.
Note, however, that the entropy coding is generally a large load to the encoder defined in the JPEG-2000. On the other hand, codes generated by encoding data at a target compression rate or bit rate include some ones that are not actually usable and they will eventually be inutile.
Since the above rate control is done in the downstream of an entropy encoder, however, it is not possible to confirm in the entropy coding that the rate control is made of a final code stream and thus all the data have to be encoded.